/*
 * server.h
 *
 *  Created on: 20-12-2010
 *      Author: marseel
 */

#ifndef SERVER_H_
#define SERVER_H_

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <string>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
#include <sstream>

using namespace std;

#define BACKLOG 10

class server {
public:
	server();
	virtual ~server();
	void *get_in_addr(struct sockaddr *sa);
	void setMessage(string m);
	void setPort(int p);
	int Send();
private:
    string PORT;
    string message;
    int sockfd, new_fd;
    struct addrinfo hints, *servinfo, *p;
    struct sockaddr_storage their_addr;
    socklen_t sin_size;
    struct sigaction sa;
    int yes;
    char s[INET6_ADDRSTRLEN];
    int rv;
};

#endif /* SERVER_H_ */
